<!DOCTYPE html>
<html>
<head>
    <title>原料耗材库</title>
    <#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
    <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div class="row" v-show="showList">
        <div class="col-md-2 panel panel-default">
            <div class="panel-heading">耗材分类</div>
            <ul id="categoryTree" class="ztree"></ul>
        </div>
        <div class="col-md-10 panel panel-default">
            <div class="panel-heading">耗材列表</div>
            <form class="form-inline" role="form">
                <a @click="reset"><i class="fa fa-refresh"></i></a>
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.materialName" @keyup.enter="query" placeholder="耗材名称">
                </div>&nbsp;&nbsp;&nbsp;
                <el-tooltip class="item" effect="dark" content="此处查询不针对分类查询" placement="top-start">
                <a class="btn btn-default btn-sm"  @click="query">查询</a>&nbsp;&nbsp;&nbsp;
                </el-tooltip>
            </form>
            <table id="jqGrid"></table>
            <div id="jqGridPager"></div>
        </div>
    </div>
    <div v-show="!showList" class="panel panel-default" >
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">耗材编号:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.materialCode" placeholder="耗材编号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">耗材名称:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.materialName" placeholder="耗材名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">分类:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" style="cursor:pointer;" v-model="material.categoryName" @click="materialCategoryTree" readonly="readonly" placeholder="一级分类"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">单位:</div>
                <div class="col-sm-10">
                    <!--<ziyun-select :options="options" v-model="material.unit" class="col-sm-12"></ziyun-select>-->
                    <select class="form-control" v-model="material.unit">
                        <option v-for="item in e.materialUnitList" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">型号:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.materialModel" placeholder="型号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">规格:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.specifications" placeholder="规格"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">长(单位米):</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.length" placeholder="长(单位米)"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">宽(单位米):</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.width" placeholder="宽(单位米)"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">克重(g):</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.weight" placeholder="克重(g)"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary btn-sm" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning btn-sm" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<!-- 选择耗材分类 -->
<div id="materialCategoryLayer" style="display: none;padding:10px;">
    <ul id="materialCategoryTree" class="ztree"></ul>
</div>
<script src="${request.contextPath}/statics/js/modules/storeMaterials/material.js?_${.now?long}"></script>
</body>
</html>